<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String path=request.getContextPath(); %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加用户</title>
<script type="text/javascript">
	function checkForm() {
		var loginname=document.getElementById("loginname").value;
		var password=document.getElementById("password").value;
		var prepassword=document.getElementById("prepassword").value;
		if(null==loginname|""==loginname)
		{
			alert("loginname没写");
			return false;
		}
		if(null==password|""==password)
		{
			alert("password没写");
			return false;
		}
		if(password!=prepassword)
		{
			alert("两次密码不同");
			return false;
		}
	}
</script>
</head>
<body>

	<h2 style="text-align: center">用户修改</h2>
	<form action="<%=path %>/StuUpdateAction" onsubmit="return checkForm();" method="post">
		<table width="50%" style="margin-left: 25%" border="1">
			<tr>
				<td align="right">姓名：</td>
				<input type="hidden" value="${stu.id }" name="id" />
				<td><input type="text" id="loginname" name="loginname" value="${stu.loginname }"/></td>
			</tr>
			<tr>
				<td  align="right">密码：</td>
				<td><input type="password" id="password" name="password" value="${stu.password }"/></td>
			</tr>
			<tr>
				<td  align="right">密码：</td>
				<td><input type="password" id="prepassword" name="prepassword" value="${stu.password }"/></td>
			</tr>
			<tr>
				<td style="text-align: right">性别：</td>
		 		<td>
		 			<select name="sex" id="sex">
		 				<c:if test="${stu.sex=='男' }"><option value="男">男</option></c:if>
		 				<c:if test="${stu.sex=='女' }"><option value="女">女</option></c:if>
		 				<option value="男">男</option>
		 				<option value="女">女</option>
		 			</select>
				</td>
			</tr>
			<tr>
				<td colspan="2" style="text-align: center">	
					<input type="submit" value="提交"/>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>